home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19990725-20000114 / 000137_news@columbia.edu _Mon Oct 4 12:22:46 1999.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA29991
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 4 Oct 1999 12:22:46 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id LAA04230
  7.     for kermit.misc@watsun.cc.columbia.edu; Mon, 4 Oct 1999 11:57:56 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: carrier-watch. How do I set it off???
  11. Date: 4 Oct 1999 15:57:55 GMT
  12. Organization: Columbia University
  13. Message-ID: <7taiq3$442$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <37F8B572.F0134ECF@americasm01.nt.com>,
  17. Yoner, Clinton (EXCHANGE:WDLN2:2Y64) <cyoner@americasm01.nt.com> wrote:
  18. : I am running a script which starts kermit as follows:
  19. :   kermit -C "log session $2, c, exit" -l /dev/$1 -b 9600
  20. : With kermt 7.0 beta (i am running Linux 6.0) it barks about the
  21. : "carrier" and I have to set it "OFF"
  22. : Yes I am just talking to a device ( not a modem) via TTYS1.
  23. : So am looking for a command-line option to add to the above kermit call
  24. We don't have command-line options that correspond to every command and
  25. setting.  That's what the -C "commandlist" escape clause is for:
  26.  
  27.   kermit -C "set car of, set lin /dev/$1, set sp 9600, l s $2, c, ex"
  28.  
  29. (Minimal abbreviations are used to keep the line length down.)  The trick is
  30. to put everything in the command list, because when you mix a command list
  31. with command-line options, the order of execution might not be what you
  32. expect (see "Using C-Kermit", pp.461-462, for details).
  33.  
  34. C-Kermit 7.0 supports a new execution method, called the "kerbang" script,
  35. in which Kermit scripts can be run as if they were shell scripts (or Perl
  36. scripts, etc), with arguments passed on the command line.  Here is a sample,
  37. which illustrates how to add robustness (arguments are checked for, errors
  38. are handled, etc):
  39.  
  40.   #!/usr/local/bin/wermit +
  41.   if not def \%1 exit 1 \%0: Device name required
  42.   if not def \%2 exit 1 \%0: Logfile name required
  43.   log session \%2
  44.   if fail exit 1 Can't open logfile \%2
  45.   set modem type none
  46.   set carrier-watch off
  47.   set line /dev/\%1
  48.   if fail exit 1 Can't open /dev/\%1
  49.   set speed 9600
  50.   connect
  51.   exit
  52.  
  53. Save it as "makeaconnection" and then you can:
  54.  
  55.   $ makeaconnection ttyS0 foo.log
  56.  
  57. For details, plus lots of examples of kerbang scripts, see:
  58.  
  59.   http://www.columbia.edu/kermit/ckscripts.html
  60.  
  61. - Frank